<template>
	<view class="news-page">
		<view class="featured-news">
			<view class="news-image">
				<image src="../../static/images/new1.jpg" mode=""></image>
				<view class="news-overlay">
					<text class="news-title">如何利用科技进行环保</text>
					<button class="read-btn">开始阅读</button>
				</view>
			</view>
		</view>
		<view class="filter-section">
			<text class="past-issues">往期</text>
			<view class="filter">
				<text>筛选</text>
				<image src="@/static/icons/filter.png" mode=""></image>
			</view>
		</view>
		<view class="news-list">
			<view class="news-item">
				<view class="news-content">
					<text class="news-subtitle">可再生能源发展新趋势</text>
					<view class="news-meta">
						<text>发布时间：2023-10-04</text>
						<text class="source">来源：绿色科技</text>
					</view>
				</view>
				<image src="@/static/images/news-energy.jpg" mode="aspectFill"></image>
			</view>
		</view>
	</view>
</template>

<script setup>
	// 可以在这里添加需要的逻辑
</script>

<style scoped lang='scss'>
	.news-page {
		font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
		height: 100vh;
		background: linear-gradient(#fff, #C8E6C9 100%);

		.featured-news {
			margin: 40rpx;

			.news-image {
				position: relative;
				border-radius: 16rpx;
				/* overflow: hidden; */
				height: 600rpx;

				image {
					width: 100%;
					height: 100%;
				}

				.news-overlay {

					.news-title {
						position: absolute;
						top: 50rpx;
						left: 50%;
						transform: translateX(-50%);
						color: #fff;
						/* 想让字成一行 */
						white-space: nowrap;
						font-size: 48rpx;

					}

					.read-btn {
						position: absolute;
						/* font-size: 28rpx; */
						bottom: 20rpx;
						right: 18rpx;
						width: 160rpx;
						height: 60rpx;
						font-size: 28rpx;
						background-color: #FDCB6E;
						white-space: nowrap;
						line-height: 60rpx;

					}
				}
			}
		}

		.filter-section {
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 0 40rpx;
			margin: 40rpx 0;

			.past-issues {
				font-size: 32rpx;
				color: #333;
				font-weight: bold;
			}

			.filter {
				display: flex;
				align-items: center;

				text {
					font-size: 32rpx;
					color: #333;
					margin-right: 16rpx;
				}

				image {
					width: 48rpx;
					height: 48rpx;
				}
			}
		}

		.news-list {
			/* background-color: white; */
			border-top: 1rpx solid #BBB;
			margin: 0 30rpx;
			/* border-bottom: 1rpx solid #eee; */
			padding: 0 40rpx;

			.news-item {
				display: flex;
				padding: 40rpx 0;
				/* border-bottom: 1rpx solid #f0f0f0; */
				align-items: center;

				.news-content {
					/* flex: 1; */

					.news-subtitle {
						font-size: 36rpx;
						color: #333;
						font-weight: bold;
						margin-bottom: 16rpx;
					}

					.news-meta {
						margin-top: 30rpx;
						width: 300rpx;
						display: flex;
						flex-direction: column;
						justify-content: center;
						align-items: center;
						font-size: 28rpx;
						color: #999;

						/* .source {
							margin-left: 30rpx;
						} */
					}
				}

				image {
					width: 160rpx;
					height: 160rpx;
					border-radius: 8rpx;
					margin-left: 60rpx;
				}
			}
		}


	}
</style>